[1] -0.6264538 0.1836433 -0.8356286 1.5952808 0.3295078 -0.8204684
[7] 0.4874291 0.7383247 0.5757814 -0.3053884
Lecture 7
set.seed function [1] -0.6264538 0.1836433 -0.8356286 1.5952808 0.3295078 -0.8204684
[7] 0.4874291 0.7383247 0.5757814 -0.3053884
[1] -0.6264538 0.1836433 -0.8356286 1.5952808 0.3295078 -0.8204684
[7] 0.4874291 0.7383247 0.5757814 -0.3053884
\[ X \sim U(0,1) \]
So, the definition is:
A sequence of random numbers is formed by real numbers in the interval (0,1) generated in sequence, independently and with the same probability.
\[ X_{n+1} = X_n (\text{ mod } m) \]
\[ A=\pi r^2 \] where \(A\) is the area of the circle and \(r\) its radius
nsim grains of sand within a square of side \(l=2\).approximating_pi_with_sand.R script10:00
rnorm, rchisq, rpois, rbinom and many many (even much more complex!) more